#include "pch.h"
#include "../GodFromPeopleClient/EnumArray.h"

enum class TestEnum {
    A, B, Max
};

class EnumArrayTest : public ::testing::Test {
protected:
    EnumArrayTest(){
        enumArray.at(TestEnum::A) = 1;
    };
    EnumArray<TestEnum, int> enumArray;
};

TEST_F(EnumArrayTest, InitTest){
    EXPECT_EQ(enumArray.at(TestEnum::A), 1);
}

TEST_F(EnumArrayTest, SetTest){
    enumArray.at(TestEnum::B) = 2;
    EXPECT_EQ(enumArray.at(TestEnum::B), 2);
}

TEST_F(EnumArrayTest, OperatorTest){
    enumArray[TestEnum::A] = 3;
    EXPECT_EQ(enumArray.at(TestEnum::A), 3);
}

TEST_F(EnumArrayTest, OutOfRangeTest){
    EXPECT_THROW(enumArray.at(TestEnum::Max), std::out_of_range);
}